import time

import pymorphy2

from . import scraper


def main(reboot_time: int, stop_words: str) -> None:
    """ Точка входа. Запускаем парсер """

    morph = pymorphy2.MorphAnalyzer()
    browser = scraper.Scraper().open_application_page()

    while True:
        scraper.Scraper().start_collection_applications(
            browser,
            morph,
            stop_words
        )
        print(f'Ждем {reboot_time} секунд')
        time.sleep(reboot_time)
        scraper.Scraper().update_list_of_applications(browser)
